import http from '../request.js'

// 获取报告基础信息配置列表
let getReportBaseInfoConfig = (url) => {
    return http.req(
        'get',
        url = 'arch/reportBaseInfoConfig/getList',
        null,
        null
    )
}

// 获取报告配置信息
let getReportInfo = (url,reportId) => {
    return http.req(
        'get',
        url = 'arch/report/getInfo?reportId='+reportId,
        null,
        null
    )
}

// 获取生成报告信息
let getGenerateInfo = (url,reportId,operationId) => {
    return http.req(
        'get',
        url = 'arch/report/getGenerateInfo?reportId='+reportId+'&operationId='+operationId,
        null,
        null
    )
}

// 添加报告配置信息
let addReportBase = (url,data) => {
    return http.req(
        'post',
        url = 'arch/report/add',
        null,
        data
    )
}

// 报告列表查询
let reportGetList = (url,params) => {
    return http.req(
        'get',
        url = 'arch/report/getList',
        params,
        null
    )
}

// 删除报告配置信息
let removeReport = (url,reportId) => {
    return http.req(
        'delete',
        url = 'arch/report/remove?reportId='+reportId,
        null,
        null
    )
}

// 修改报告配置信息
let editReportBase = (url,data) => {
    return http.req(
        'put',
        url = 'arch/report/edit',
        null,
        data
    )
}

// 使用报告模板
let ReportlUse = (url,reportId) => {
    return http.req(
        'post',
        url = 'arch/report/use?reportId='+reportId,
        null,
        null
    )
}

// 取消使用报告模板
let ReportCancelUse = (url,reportId) => {
    return http.req(
        'post',
        url = 'arch/report/cancelUse?reportId='+reportId,
        null,
        null
    )
}

// 生成报告
let generateReport = (url,data) => {
    return http.req(
        'post',
        url = 'arch/report/generate',
        null,
        data
    )
}

export default {
    getReportBaseInfoConfig,
    getReportInfo,
    addReportBase,
    reportGetList,
    removeReport,
    editReportBase,
    ReportCancelUse,
    ReportlUse,
    getGenerateInfo,
    generateReport
}